home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / iftod12.zip / IFTODAY.DOC next >
Text File  |  1991-04-11  |  8KB  |  158 lines

  1.     Page 1     IFTODAY
  2.  
  3.                                     IfToday
  4.                                   Version 1.2
  5.                       A Simple Batch FIle Control Utility
  6.                                 from MidWest BBS
  7.                                 St.  Charles, IL
  8.                                  (708) 513-1034
  9.  
  10.  
  11.  
  12.           There are several fine utilities available to control whether
  13.           or not a program and/or batch file is executed based on certain
  14.           criteria.  Frankly, we felt that most were overly complicated
  15.           or didn't meet our needs on MidWest.   We developed this
  16.           program to control our daily "event" batch file on the BBS,
  17.           since there are a number of programs which don't need to be
  18.           executed every day.
  19.           
  20.           The basic premise is simple, based on the day of the week or
  21.           month a command is either passed to DOS or is skipped.   The
  22.           syntax is as follows:
  23.                     
  24.                IfToday [Which Day] [Command Line]
  25.           
  26.                "Which Day" is either a day of the week, day of the
  27.                month, odd/even days or beginning or ending of the month,
  28.                etc.  "Command Line" is the normal command passed to DOS.
  29.                A few examples should make this clear.
  30.           
  31.           
  32.                Example 1:  IfToday Friday Vopt
  33.           
  34.                            If you wanted to optimize your disk only on
  35.                            Friday, this is the way it would look.
  36.                            IfToday checks the internal clock and if it
  37.                            is Friday then Vopt is executed, if not,
  38.                            nothing happens.
  39.           
  40.           
  41.                Example 2:  IfToday 10 DS N \/S
  42.           
  43.                            If you wanted to sort your directories on the
  44.                            10th of each month, this would be the
  45.                            command.   Again, after checking the internal
  46.                            clock, the entire command, "DS N \/S" would
  47.                            be passed to DOS if it was the 10th of the
  48.                            month.
  49.           
  50.                Example 3:  IfToday Even Chkdsk > Check
  51.           
  52.                            If you ran ChkDsk only on even days of the
  53.                            month and redirected the output to a file
  54.                            called "Check", this would do it.
  55.  
  56.           
  57.     Page 2     IFTODAY
  58.  
  59.  
  60.           I'm sure you get the idea.   If there are any problems, just
  61.           drop by MidWest BBS and leave a note.   We operate 24 hours a
  62.           day at baud rates up to 9600(HST).
  63.           
  64.           
  65.           Here's a list of commands IfToday understands:
  66.           
  67.           Days of the Week:  Sunday, Monday, Tuesday, Wednesday,
  68.                              Thursday, Friday, Saturday, Sun, Mon, Tue,
  69.                              Wed, Thu, Fri, Sat
  70.           
  71.           Any Numerical day of the month : 1..31 (There's minimal leap
  72.                                            year logic built in).
  73.           
  74.           Odd or Even Days of the month:  Odd, Even
  75.           
  76.           First or Last Day of the month:  Begin, End, Beginning,
  77.                                            Ending, First, Last
  78.  
  79.           Morning or Evening : AM, PM, P.M., A.M., Morning, Evening
  80.  
  81.           
  82.           Commands are NOT case sensitive.
  83.           
  84.  
  85.           11/15/90 - We've added a daily log of commands executed by
  86.           IFToday.  The log file is called IFTODAY.LOG and is created in
  87.           the same directory as IFTODAY.EXE.   This is a daily log, i.e.
  88.           only commands executed during one calendar day are logged. The
  89.           next day the file is erased and a new log created.   It will
  90.           also log a failure to run due to an insufficient number of
  91.           parameters.
  92.  
  93.           12/12/90 - Several additional "whens" were also added - see
  94.           documentation.
  95.  
  96.           04/02/91 - Two approches have been added to prevent the
  97.           execution of commands within a single day or other time
  98.           period.  The first, which is of limited usage, is the use of
  99.           an environment variable NOMORE.  By using the command "SET
  100.           IFTODAY=NOMORE"  you can prevent any action being taken by
  101.           IfToday.  This is obviously no good after a reboot, but is
  102.           there for those that may find it useful.  By the way, issuing
  103.           the command "SET IFTODAY=" will remove the environment
  104.           variable and allow IfToday to function normally.
  105.  
  106.           The other method writes to a small file, which is maintained
  107.           in the same directory as IfToday.Exe, called IfToday.Tst.  The
  108.           one and only entry in this file is the current date.  If
  109.           IfToday finds this file and the date in the file matches the
  110.           current date, it will refuse to run.  IfToday.Tst is created
  111.           by issuing the command "IFTODAY UPDATE" and will be erased
  112.           with the command "IFTODAY NOUPDATE".  Conceptually, the last
  113.           command in a daily batch file would be the command to create
  114.           IfToday.Tst and any further attempts to use IfToday, that day,
  115.           would be prevented.  The "NOUPDATE" parameter may be used to
  116.           release IfToday for further usage.  It is not necessary to
  117.           erase IfToday.Tst prior to the issuance of the UPDATE command.
  118.     Page 3     IFTODAY
  119.  
  120.  
  121.           Something else which may not be immediately apparent is the
  122.           ability to run IfToday "recursively".  For example "IFTODAY 5
  123.           IFTODAY UPDATE" would only create the update file on the 5th
  124.           of the month.  Another example - " IFTODAY 1 IFTODAY MON
  125.           DOSOMETHING".  DOSOMETHING would only execute on Moday the
  126.           first.  This could be very useful in certain situations.  As a
  127.           matter of fact, IFToday calls could be strung together up to
  128.           the limit of the DOS command line, although that might get a
  129.           little ridiculous.  This does use an additional 40K of memory
  130.           with each recursion, as Command.Com is loaded each time, but
  131.           should present no problems for 1 or 2 iterations.
  132.  
  133.           These new features require the use of DOS 3.0 or greater.
  134.           Attempts to run IFToday under a lesser version of DOS will not
  135.           work.
  136.  
  137.           One other obscure feature which was put in for a single need,
  138.           is the ability of IFToday to operate properly when it is named
  139.           something else.  IfToday.Log and IfToday.Tst will still be
  140.           located in the directory where the executable program resides,
  141.           whatever it is called.  Again, a limited use feature, but it
  142.           is available if needed.
  143.           
  144.  
  145.  
  146.                                     License
  147.                     
  148.           IfToday is a copyright product of MidWest BBS.   You are free
  149.           to use it in any fashion you choose.   This includes both
  150.           personal and business environments.   There is no charge.
  151.           If, however, you find this a useful program, gifts of $100,000
  152.           and up would be greatly appreciated and would certainly
  153.           encourage us to continue developing more trivial utilities.
  154.           We made a strong effort to ensure that this program works as
  155.           claimed, but will not be held liable for any damages, direct
  156.           or consequential, which result from the use of the program.
  157.           Use it at your own risk. 
  158.